:root {
    --bg-color: #f5f5f5;
    --text-color: #333;
    --primary-color: #4CAF50;
    --hover-color: #45a049;
    --dark-bg-color: #333;
    --dark-text-color: #f0f0f0;
    --dark-primary-color: #555;
}

body {
    font-family: 'KaiTi', serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    text-align: center;
    margin: 20px;
    transition: background-color 0.3s, color 0.3s;
    padding: 0;
    box-sizing: border-box;
}

h1 {
    font-size: 48px;
    font-weight: bold;
    font-family: 'Microsoft YaHei', sans-serif;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.button-container, .control-buttons {
    margin: 20px auto;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    transition: transform 0.2s;
}

.button-container button, .control-buttons button {
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    font-family: 'KaiTi', serif;
    border: none;
    border-radius: 6px;
    background-color: var(--primary-color);
    color: white;
    transition: background-color 0.3s, transform 0.3s;
}

.button-container button:hover, .control-buttons button:hover {
    background-color: var(--hover-color);
    transform: scale(1.05);
}

table {
    margin: 20px auto;
    border-collapse: collapse;
    font-size: 18px;
    width: 80%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

th, td {
    border: 1px solid #ccc;
    padding: 15px 30px;
    text-align: center;
    font-family: 'KaiTi', serif;
}

th {
    background-color: #f8f8f8;
}

.visualization {
    display: flex;
    justify-content: space-around;
    margin: 20px auto;
    flex-wrap: wrap;
    gap: 20px;
}

canvas {
    max-width: 400px;
    max-height: 400px;
    transition: transform 0.3s ease;
}

.slider-container {
    position: fixed;
    top: 20px;
    right: 20px;
}

.instructions, .version-info {
    position: fixed;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dark-mode {
    background-color: var(--dark-bg-color);
    color: var(--dark-text-color);
}

.dark-mode button {
    background-color: var(--dark-primary-color);
    color: var(--dark-text-color);
}

.dark-mode table {
    background-color: #444;
}

.dark-mode th {
    background-color: var(--dark-bg-color);
}